<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>layuiAdmin 网站用户</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="/layuiAdmin/dist/layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="/layuiAdmin/dist/layuiadmin/style/admin.css" media="all">
    <link rel="stylesheet" href="/Font-Awesome-master/css/font-awesome.min.css">
    <script src="/layuiAdmin/dist/layuiadmin/layui/layui.js"></script>
    <script src="/js/jquery-2.1.1.min.js"></script>
    <style>
        #mc {
            height: 100vh;
            width: 100vw;
            overflow: hidden;
            position: fixed;
            background: rgba(0, 0, 0, 0.5);
            z-index: 999999;
            display: none;
            align-items: center;
            justify-content: center;
        }
        .icon{
            width: 28px;
            height: 28px;
            line-height: 28px;
            border: 1px solid #e6e6e6;
            border-top-color: rgb(230, 230, 230);
            border-right-color: rgb(230, 230, 230);
            border-bottom-color: rgb(230, 230, 230);
            border-left-color: rgb(230, 230, 230);
            text-align: center;
            border-radius: 1px;
            -webkit-transition: all .4s ease;
            transition: all .4s ease;
            float: left;
            list-style: none;
        }
        .layui-table-body{
            z-index: 0;
        }
        .layui-btn .layui-icon{
            position: unset;
            vertical-align: middle;
        }
        .tb table td{
            text-align: center;
            width: 100px;
        }
    </style>
</head>
<body>
<div id="mc">
    <img style="max-height: 90%;max-width: 90%;" src="" alt="">
</div>
<div class="layui-fluid">
    <div class="layui-card">

        <div class="layui-form layui-card-header layuiadmin-card-header-auto">
            <div style="margin: 0 30px 30px 30px;">
                <button type="button" class="layui-btn layui-btn-primary" lay-href="{:url('user_index/upload')}?id=1">基本信息</button>
                <button type="button" class="layui-btn layui-btn-normal">积分记录</button>
            </div>
            <div class="layui-form-item tb">
                <table>
                    <tr>
                        <td>{$user_index.total_integral}</td>
                        <td>{$user_index.integral}</td>
                    </tr>
                    <tr>
                        <td>累计获得</td>
                        <td>当前积分</td>
                    </tr>
                </table>
            </div>
        </div>
        <div class="layui-card-body">
            <div class="layui-btn-group" style="padding-bottom: 10px;">
            </div>
            <table id="demo" lay-filter="test"></table>
        </div>
    </div>
</div>
<script type="text/html" id="list_setting">
    <div class="layui-btn-group">
        {block name="setting_botton"}
        <button type="button" lay-href="{:url('upload')}?id={{d.id}}"  class="layui-btn  layui-btn-sm upload">详情
        </button>
        {/block}
    </div>
</script>
<!--系统图标-->
<script type="text/html" id="list_icon">
    {{#if (d.icon){ }}
    <div class="icon"><i class="{{d.icon}}"></i></div>
    {{#} }}
</script>
<!--常规图片-->
<script type="text/html" id="list_image">
    <img src="{{d.image}}" onclick="fdtop('{{d.image}}')" alt="">
</script>
{block name="js"}
{/block}
<!-- 配置文件 -->
<script type="text/javascript" src="/plug/UEditor/ueditor.config.js"></script>
<!-- 编辑器源码文件 -->
<script type="text/javascript" src="/plug/UEditor/ueditor.all.js"></script>
<script>


    layui.config({
        base: '/layuiAdmin/dist/layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'useradmin', 'table', 'layer','laydate'], function () {

        var $ = layui.$
            , form = layui.form
            , table = layui.table
            , layer = layui.layer
            , laydate = layui.laydate
        laydate.render({
            elem: '#time_time'
            ,type: 'datetime'
            ,range: '到'
            ,format: 'yyyy-M-d H:m:s'
        });
        //表格
        var web_table = "{$table}";
        web_table = JSON.parse(web_table.replace(/&quot;/g, '"'));
        "{if $cs_url}"
        var url = "{:url('datalist')}" + "{$cs_url}";
        "{else}"
        var url = "{:url('datalist')}";
        "{/if}"
        table.render({
            elem: '#demo'
            , limit: 50
            , url: url//数据接口
            , page: true //开启分页
            , cols: [web_table]
        });
        //监听搜索
        form.on('submit(LAY-user-front-search)', function (data) {
            var field = data.field;

            //执行重载
            table.reload('demo', {
                where: field
            });
        });
    });
    function data_url(table = null){
        //优化
        $.ajax({
            url:"{:url('optimize')}",
            data:{tables:table},
            success:function(res){
                console.log(res);
            }
        })
    };

    //弹出查看图片
    function fdtop(img) {
        $("#mc").css({display:'flex'});
        $("#mc").find('img').attr('src',img);
    }
    //关闭弹出层
    $("#mc").click(function(){
        $("#mc").hide();
    })
</script>
</body>
</html>
